package com.anpy.album.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;

@Entity
@Data
@TableName(value = "photo_entity")
public class PhotoEntity {

    @TableField(value = "album_id")
    private Integer albumId;
    @TableField(value = "photo_name")
    private String photoName;
    @TableField(value = "photo_url")
    private String photoUrl;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_at")
    private Date createAt;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_at")
    private Date updateAt;
    @TableField(value = "user_id")
    private Integer userId;
    @Id
    private Long id;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "deleted_at")
    private Date deletedAt;
    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }
}
